package com.baijiayun.live.ui.pptpanel.popupwindow

import android.content.Context
import androidx.core.content.ContextCompat
import android.view.View
import com.baijiayun.live.ui.R
import com.baijiayun.live.ui.base.RouterViewModel
import com.baijiayun.liveuibase.utils.DisplayUtils
import com.baijiayun.liveuibase.widgets.popupwindow.BaseAutoArrangePopupWindow
import com.baijiayun.liveuibase.widgets.toolbar.BaseGraphMenuWindow
import com.baijiayun.liveuibase.widgets.toolbar.ColorSelectData
import com.baijiayun.liveuibase.widgets.toolbar.WidthSelectData

class DrawGraphPopupWindow(context: Context, private val routerViewModel: RouterViewModel)
    : BaseGraphMenuWindow(context) {
    private var defaultDrawable: OnShapeChangeModel? = null

    init {
        onChangeShape(defaultDrawable)
        if (DisplayUtils.isPad(context)) {
            setDirectionMode(BaseAutoArrangePopupWindow.HORIZONTAL)
        }
    }

    override fun onChangeColor(colorSelectData: ColorSelectData?) {
        routerViewModel.drawColorChange.value = colorSelectData
    }

    override fun onChangeWidth(widthSelectData: WidthSelectData) {
        routerViewModel.drawWidthChange.value = widthSelectData
    }

    override fun onChangeShape(onShapeChangeModel: OnShapeChangeModel?) {
        routerViewModel.drawGraphChange.value = onShapeChangeModel
    }

    override fun initDefaultDrawable(initShapeModel: OnShapeChangeModel?) {
        defaultDrawable = initShapeModel
    }
}